package com.lisn.toastlib;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;

public class ToastTestActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_toast_test);

        findViewById(R.id.textView_success).setOnClickListener(v ->
                ToastUtils.onSuccessShowToast("成功toast"));
        findViewById(R.id.textView_error).setOnClickListener(v ->
                ToastUtils.onErrorShowToast("失败toast"));
        findViewById(R.id.textView_default).setOnClickListener(v ->
                ToastUtils.onDefaultShowToast("默认toast"));
        findViewById(R.id.textView_warn).setOnClickListener(v ->
                ToastUtils.onWarnShowToast("Warn toast"));
        findViewById(R.id.textView_info).setOnClickListener(v ->
                ToastUtils.onInfoShowToast("Info toast"));

        findViewById(R.id.textView_custum1).setOnClickListener(v ->
                ToastUtils.onShowToast("自定义1", 0,
                        R.drawable.toast_custum1_shape));
        findViewById(R.id.textView_custum2).setOnClickListener(v ->
                ToastUtils.onShowToast("自定义2", R.mipmap.ic_launcher_round,
                        R.drawable.toast_custum2_shape));

    }

    public static void startActivity(Context context) {
        context.startActivity(new Intent(context, ToastTestActivity.class));
    }
}